import { createRouter,createWebHashHistory} from "vue-router";
import HelloWorld from '../components/HelloWorld.vue'
import home from '../view/Common/page/home/index.vue'
const routerHistory = createWebHashHistory();
import { routersMap, routersList } from '../view';
// const awaitRouterMap = await routerMap;
// const routerList = Object.keys(awaitRouterMap).map(el => {
//   return {
//     ...awaitRouterMap[el]
//   }
// });

const routers = () => {
  // const awaitRouterMap = routerMap;
  // console.log(22, awaitRouterMap);
// const routerList = Object.keys(awaitRouterMap).map(el => {
//   return {
//     ...awaitRouterMap[el]
//   }
// });
  return [
    {
      path: '/',
      component: HelloWorld,
      meta: {
        keepId: "qqqq"
      }
    },
    {
      path: '/home2',
      component: home,
      meta: {
        keepId: "qqqq"
      }
    },
    ...routersList
  ]
};

export default createRouter({
  history: createWebHashHistory(),
  routes: routers()
})
